home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
HTBasic 9.3
/
HTBasic 9.3.iso
/
83win
/
data1.cab
/
Basic_Plus_Examples
/
EMPANEL
< prev
next >
Wrap
Text File
|
2001-03-02
|
3KB
|
49 lines
10 ! ********************************************************
20 ! Example: Engine Monitor - Panel of Widgets
30 !
40 ! This program displays a simulated engine monitor for
50 ! a theoretical engine. Torque, pressure, and dwell are
60 ! displayed, as well as a Status Log.
70 !
80 ! ********************************************************
90 !
100 DIM Buf$[200]
110 !
120 ASSIGN @Panel TO WIDGET "PANEL";SET ("X":5,"Y":5,"WIDTH":400,"HEIGHT":320,"TITLE":" Example: Engine Monitor - Panel of Widgets","MAXIMIZABLE":1)
130 CONTROL @Panel;SET ("SYSTEM MENU":"Quit")
140 ON EVENT @Panel,"SYSTEM MENU" GOTO Finis
150 !
160 ASSIGN @M1lbl TO WIDGET "LABEL";SET ("X":5,"Y":5,"WIDTH":90,"HEIGHT":20,"VALUE":"Torque","BORDER":0),PARENT @Panel
170 ASSIGN @Meter1 TO WIDGET "METER";SET ("X":5,"Y":30,"WIDTH":90,"HEIGHT":160,"ARC WIDTH":3,"ORIENTATION":"RIGHT","SHOW LIMITS":0),PARENT @Panel
180 !
190 ASSIGN @B2lbl TO WIDGET "LABEL";SET ("X":150,"Y":5,"WIDTH":80,"HEIGHT":20,"VALUE":"Pressure","BORDER":0),PARENT @Panel
200 ASSIGN @Bar2 TO WIDGET "BAR";SET ("X":160,"Y":30,"WIDTH":60,"HEIGHT":90),PARENT @Panel
210 ASSIGN @B2dsp TO WIDGET "LABEL";SET ("X":160,"Y":125,"WIDTH":60,"HEIGHT":20,"BORDER":0),PARENT @Panel
220 !
230 ASSIGN @Lbl1 TO WIDGET "LABEL";SET ("X":270,"Y":5,"WIDTH":75,"HEIGHT":20,"BORDER":0,"VALUE":"Dwell"),PARENT @Panel
240 ASSIGN @Disp1 TO WIDGET "LABEL";SET ("X":270,"Y":30,"WIDTH":75,"HEIGHT":20),PARENT @Panel
250 ASSIGN @Lbl TO WIDGET "LABEL";SET ("X":130,"Y":155,"WIDTH":240,"HEIGHT":20,"VALUE":"Status Log","BORDER":0),PARENT @Panel
260 ASSIGN @Text TO WIDGET "PRINTER";SET ("X":130,"Y":185,"WIDTH":240,"HEIGHT":100),PARENT @Panel
270 !
280 Value=50
290 Siz=15
300 Loop_val:!
310 FOR I=1 TO 10000
320 IF Value<25 OR Value>=85 THEN Value=50
330 Torq=INT(Value+Siz*RND)
340 Pres=INT(Value+Siz*RND)
350 Dwell=INT(Value+Siz*RND)
360 Value=INT(Value+Siz*(RND-.5))
370 !
380 CONTROL @Meter1;SET ("VALUE":Torq)
390 CONTROL @Bar2;SET ("VALUE":Pres)
400 CONTROL @B2dsp;SET ("VALUE":Pres)
410 CONTROL @Disp1;SET ("VALUE":Dwell)
420 OUTPUT Buf$ USING "#,K,DDDD,3X,DDD,DDD,DDD";"Update #";I,Torq,Pres,Dwell
430 CONTROL @Text;SET ("APPEND TEXT":Buf$)
440 NEXT I
450 GOTO Loop_val
460 !
470 STOP
480 Finis: END